<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<% String basepaths = request.getContextPath(); %>
<%--<div id="location">当前位置：首页 > 招聘实施 > 中专校园招聘 > 简历管理</div>--%>
<div id="Content" style="min-width: 1590px">
    <%--   <div class="btnbar">
       <button type="button" class="view" id="zzuser_view">查看毕业生信息</button>
        &lt;%&ndash; <button type="button" class="card" id="do_zzopen">开启</button>
         <button type="button" class="card" id="do_zzclose">关闭</button>&ndash;%&gt;
         <button type="button" class="save" id="resume_ok">通过</button>
         <button type="button" class="del" id="resume_no">未通过</button>
         <button type="button" class="card" id="zzpublishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
         <button type="button" class="import" id="do_downinfo">导出应聘者信息</button>
         <button type="button" class="list" id="do_zznext">进入下一步</button>
         <button type="button" class="save" id="resume_output">导出</button>
         <button type="button" class="save" id="resume_input">导入</button>
         <button type="button" class="list" id="do_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</button>
         &lt;%&ndash;<button type="button" class="back" onclick="javascript:history.go(-1);">返 回</button>&ndash;%&gt;
     </div>--%>

    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="zzuser_view">
            <em  class="ico16 view_attachments_16"></em>
            <span  class="menu_span" title="查看毕业生信息">查看毕业生信息</span>
        </a>
        <a id="resume_ok" style="margin-left: 5px">
            <em class="ico16 gone_through_16" ></em>
            <span class="menu_span" title="通过筛选">通过筛选</span>
        </a>
        <a id="resume_no" style="margin-left: 5px">
            <em  class="ico16 stop_contract_16"></em>
            <span  class="menu_span" title="未通过筛选">未通过筛选</span>
        </a>
        <a id="zzpublishresult" style="margin-left: 5px">
            <em  class="ico16 plan_16"></em>
            <span  class="menu_span" title="公布/屏蔽结果" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</span>
        </a>
        <a id="do_zznext" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_sendmsg" style="margin-left: 5px">
            <em  class="ico16 common_language_16"></em>
            <span  class="menu_span" title="发短信">发短信</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
        <a id="send_news" style="margin-left: 5px">
            <em  class="ico16 info_16"></em>
            <span  class="menu_span" title="消息通知">消息通知</span>
        </a>
    </div>

        <!-- 消息通知 -->
        <div id="infospanel"  class="condition_cont">
            <form id="infosform" method="post" action="/Do/SendInfos/SendInfosAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
                <table class="treeTable searchform">
                    <thead>
                    <tr>
                        <td width="100">消息内容:</td>
                        <td width="500">
                            <div><textarea name="infoContent" datatype="*" nullmsg="消息内容不能为空！"></textarea></div>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <button type="submit" class="op">发送消息通知</button>
                        </td>
                        <td></td>
                    </tr>
                    </thead>
                </table>
                <div id="infosuers"></div>
                <div id="infosuerCardnos"></div>
            </form>
        </div>

    <!-- 筛选条件 -->
       <div id="searchbox">
           <form id="sform">
               <input type="hidden" name="proid" value="${pid}"/>
               <input type="hidden" name="path" value="${fid}"/>
               <input type="hidden" name="rcount" id="checkrount" value=""/>
               <table class="treeTable searchform">
                   <thead>
                   <tr>
                       <td width="60">应聘岗位:</td>
                       <td >
                           <div>
                               <%-- <input type="text" name="jname"/>--%>

                               <select name="jname">
                                   <option value="">请选择</option>
                                   <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                       <c:choose>
                                           <c:when test="${projectinfojobs!=null}">
                                               <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                           </c:when>

                                       </c:choose>
                                   </c:forEach>
                               </select>
                           </div>
                       </td>
                       <td width="60">姓名:</td>
                       <td>
                           <div><input type="text" name="name"/></div>
                       </td>
                       <td width="60">身份证号:</td>
                       <td>
                           <div><input type="text" name="cardno"/></div>
                       </td>

                       <td width="60">所学专业:</td>
                       <td >
                           <div>
                               <input type="text" name="majorname"/>
                           </div>
                       </td>
                       <td width="60">毕业院校:</td>
                       <td >
                           <div>
                               <input type="text" name="university"/>
                           </div>
                       </td>


                   </tr>
                   <tr>
                       <td >毕业时间:</td>
                       <td>
                           <div><input type="text" name="graduationtime"/></div>
                       </td>
                       <td>联系电话:</td>
                       <td>
                           <div>
                               <input type="text" name="tel"/>
                           </div>
                       </td>
                       <td>最高学历:</td>
                       <td >
                           <div><select name="education">
                               <option value="-1">不限</option>
                               ${education}</select></div>
                       </td>
                       <td>简历状态:</td>
                       <td >
                           <div> <select name="state">
                               <option value="">不限</option>
                               <option value="未处理">未处理</option>
                               <option value="已通过">已通过</option>
                               <option value="未通过">未通过</option>
                           </select></div>
                       </td>
                       <td>意向地点:</td>
                       <td >
                           <div>
                               <input type="text" name="presentsalaryamount"/>
                           </div>
                       </td>
                   </tr>
                   <tr class="moretj">
                       <td width="60">民族:</td>
                       <td width="150">
                           <div><select name="mzcode">
                               <option value="">不限</option>
                               ${minzu}</select></div>
                       </td>
                       <td width="60">政治面貌:</td>
                       <td width="150">
                           <div><select name="zzmmcode">
                               <option value="">不限</option>
                               ${zzmm}</select></div>
                       </td>
                       <td width="60" style="text-align:right;">年龄:</td>
                       <td width="160">
                           <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                       </td>
                       <%-- <td width="16" style="text-align:center;">至</td>
                        <td width="60">
                            <div><input type="text" name="ageto"/></div>
                        </td>--%>
                       <td width="60" style="text-align:right;">身高:</td>
                       <td width="160">
                           <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                       </td>
                       <%--  <td width="36" style="text-align:center;">至</td>
                         <td width="50">
                             <div></div>
                         </td>--%>
                       <td width="60">性别:</td>
                       <td>
                           <div>
                               <select name="sexname">
                                   <option value="">不限</option>
                                   <option value="男">男</option>
                                   <option value="女">女</option>
                               </select>
                           </div>
                       </td>
                   </tr>
                   <tr class="moretj">


                       <td>户口所在地:</td>
                       <td>
                           <div><input type="text" name="hukouaddress"/></div>
                       </td>
                       <td>现居住地:</td>
                       <td>
                           <div><input type="text" name="nowaddress"/></div>
                       </td>
                       <td>是否放弃:</td>
                       <td>
                           <div>
                               <select name="fqstate">
                                   <option value="">全部</option>
                                   <option value="未放弃" selected>未放弃</option>
                                   <option value="已放弃">已放弃</option>
                               </select>
                           </div>
                       </td>
                       <td width="60">是否转岗:</td>
                       <td width="100">
                           <div>
                               <select name="ischangejob">
                                   <option value="">全部</option>
                                   <option value="是">是</option>
                                   <option value="否">否</option>
                               </select>
                           </div>
                       </td>
                       <td colspan="2"></td>
                   </tr>

                   <tr>
                       <td colspan="2">
                           <%--<div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                               <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                           </div>--%>
                           <div class="toolbars">
                               <a id="searchbtn">
                                   <em class="ico16 search_16"></em>
                                   <span >查询</span>
                               </a>
                               <a id="clearbtn">
                                   <em class="ico16 refresh_16"></em>
                                   <span>清除</span>
                               </a>
                           </div>
                       </td>
                       <td colspan="8">
                         <%--  <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                   title="高级查询"></button>--%>
                           <div class="toolbars">
                               <a onclick="moreparam()">
                                   <em class="ico16 search_disable_16"></em>
                                   <span >高级查询</span>
                               </a>
                           </div>
                       </td>
                   </tr>
                   </thead>
               </table>
           </form>
       </div>

   <%-- <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="pid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="80">学校名称：</td>
                    <td width="200">
                        <div><select name="adduid">${school}</select></div>
                    </td>
                    <td width="80">姓名：</td>
                    <td width="150">
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="80">身份证号：</td>
                    <td width="150">
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td width="60"></td>
                    <td></td>
                </tr>
                <tr>
                    <td>所学专业：</td>
                    <td>
                        <div><input type="text" name="major"/></div>
                    </td>
                    <td>简历投递：</td>
                    <td>
                        <div>
                            <select name="rstate">
                                <option value="">全部</option>
                                <option value="已投简历">已投简历</option>
                                <option value="未投简历">未投简历</option>
                            </select>
                        </div>
                    </td>
                    <td>简历筛选：</td>
                    <td>
                        <div>
                            <select name="rrstate">
                                <option value="">全部</option>
                                <option value="已通过">已通过</option>
                                <option value="未通过">未通过</option>
                            </select>
                        </div>
                    </td>
                    <td>
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
        </form>
    </div>--%>
   <%-- <div id="page_top" class="page"></div>
    <table class="treeTable" id="tablelist">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="35">序号</td>
            <td width="60">姓名</td>
            <td width="40">性别</td>
            <td width="120">身份证号</td>
            <td>所学专业</td>
            <td width="90">毕业时间</td>
            <td width="60">在校表现</td>
            <td width="60">学历起点</td>
            <td width="100">特长</td>
            <td width="150">招聘责任部门</td>
            <td width="60">简历投递</td>
            <td width="60">简历筛选</td>
            <td width="50">公布结果</td>
            <td width="45"></td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page_bottom" class="page"></div>--%>
       <table class="layui-hide" id="tablelistZzResume" lay-filter="listTables"></table>
</div>
<script type="text/javascript">
    $("#searchbox").width($(window).width()-10);
    var nowflow="${nowflow}";

    var ptypes = "ZZResume";

    //消息通知
    $('#send_news').on('click',function () {
        getTableChecks();

        $('#infospanel').slideToggle(300);
        $(this).toggleClass('cur').blur().siblings().removeClass('cur');
    });

 //   $(document).ready(function () {
      /*  getList();
        $('#searchbtn').click(function () {
            getList();
        });*/


    var selectDataTemp = [];
    function getTableChecks(){
        var selectData = layui.table.checkStatus('listTables').data;

        if(selectDataTemp.length > 0){
            for(var i=0;i<selectDataTemp.length;i++){
                $('#infosuers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#infosuerCardnos input').each(function () {
                    if ($(this).val() == selectDataTemp[i].CARDNO)
                        $(this).remove();
                });
            }
        }
        if(selectData.length == 0){
            selectDataTemp = selectData;
        }else{
            for(var i=0;i<selectData.length;i++){
                $('#infosuers').append('<input type="hidden" name="id" value="' + selectData[i].id_cb.replace('cb_', '') + '"/>');
                $('#infosuerCardnos').append('<input type="hidden" name="cardno" value="' + selectData[i].CARDNO + '"/>');
            }
            selectDataTemp = selectData;
        }
    }
    $('#zzuser_view').click(function () {
        //EditInfo('查看毕业生信息', '/Do/ZZRecommend/view?_x=2015', '800px', '600px');
        EditInfoNew('查看毕业生信息', '/Do/ZZRecommend/view?_x=2015', '800px', '300px');
    });

    $('#do_zznext').click(function () {
        parent.layer.confirm('未通过简历筛选的应聘者不能进入下一步，是否继续？', {
            btn: ['是', '否']
        }, function () {
           // DelInfo('/Do/ZZResume/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}');
            toNextFlowNew('/Do/ZZResume/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
            parent.layer.closeAll();
        }, function () {
            parent.layer.closeAll();
        });

    });


    $('#resume_no').click(function () {
        var id = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else if(selectData.length > 1){
            parent.layer.alert('只能选择一条信息!',{icon:2});
        }else{
            id = selectData[0].id_cb.replace('cb_', '') + '';
            openpLayer('简历筛选未通过', '/Do/ZZResume/bz?id=' + id + '&pid=${pid}&fid=${fid}&deptcode=${deptcode}', '500px', '200px');
        }
    });


    $('#resume_ok').click(function () {
        var url = '/Do/ZZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
        DelInfoNew(url);
    });

    $('#resume_sendmsg').click(function () {
        var ids = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                ids += selectData[i].id_cb.replace('cb_', '') + ',';
            }
            parent.layer.confirm('将会对已发布信息发送短信。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/DUserResume/SendMessageAction';
                postAjax(url, {pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids}, function (data) {
                    if (data.state) {
                        parent.layer.alert(data.Message, {icon: 1,time:5000});
                        tableRenders();
                        var Timer = setTimeout(changeToNextTab(nowflow),500);
                        clearTimeout(1);
                    }
                    else {
                        parent.layer.alert(data.Message, {icon: 2,time:5000});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });

        }
    });

        $('#do_zzopen').click(function () {
            parent.layer.confirm('开启以后应聘者可以投简历。<br>确定要开启吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/Do/ZZResume/OpenCloseAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                postAjax(url, null, function (data) {
                    if (data.state) {
                        layer.msg(data.Message, {icon: 1});
                    }else {
                        layer.msg(data.Message, {icon: 2});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

        $('#do_zzclose').click(function () {
            parent.layer.confirm('关闭以后应聘者不能投简历。<br>确定要关闭吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/Do/ZZResume/OpenCloseAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                postAjax(url, null, function (data) {
                    if (data.state) {
                        layer.msg(data.Message, {icon: 1});
                    }else {
                        layer.msg(data.Message, {icon: 2});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

        //导出应聘者信息
        $('#do_downinfo').click(function () {
            parent.layer.confirm('导出已经投简历的应聘者信息，是否继续？', {
                btn: ['是', '否']
            }, function () {
                location = '/Do/ZZResume/DownAction?pid=${pid}'
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });

        });

   // });

    function getList() {
        $('.page').myPagination({
            cssStyle: "pagination",
            ajax: {
                on: true,
                url: '${path}/Do/ZZResume/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                }
            }
        });
    }
   // $(function () {
        $('#resume_output').click(function () {
            openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResumeBySearch?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
        });
        $('#resume_input').click(function () {
            openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
        });
   // });

    var ZzRecommendTable;
    var sdat;

    layui.config({
        base: '<%=basepaths%>/resources/js/plugins/ext/',   // 模块目录
        version: 'v1.5.10' // 插件版本号
    }).extend({
        soulTable: 'soulTable',// 模块别名
        tableChild: 'tableChild',
        tableMerge: 'tableMerge',
        tableFilter: 'tableFilter',
        // excel: 'excel',
    });

    layui.use(['table','soulTable','tableChild','tableMerge','tableFilter'], function(){
        var soulTable = layui.soulTable,
            tableChild = layui.tableChild,
            tableMerge = layui.tableMerge,
            tableFilter = layui.tableFilter,
            $ = layui.$;

        ZzRecommendTable = layui.table;
        sdat = '${path}/Do/ZZResume/getZZResumeListLayuiJson?flowid=${fid}&'+$('#sform').serialize();

        ZzRecommendTable.render({
            id:'listTables'
            ,elem: '#tablelistZzResume'
            ,url: sdat
            ,title:'用户数据表'
            , height: 'full'
            //  ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,contextmenu: {
                // 表格内容右键菜单配置
                body: [
                ]
            }

            ,cols: [[
                {type:'checkbox',fixed:'center'}
                ,{field:'id', title: '序号', fixed:'center',sort: true,minWidth:80}
                ,{field:'NAME',title: '姓名', fixed:'left',sort: true,minWidth:100,templet: function(d){
                        return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME;
                    }}
                ,{field:'SEXNAME',title: '性别', fixed:'center',minWidth:80}
                ,{field:'CARDNO',title: '身份证号', fixed:'center',minWidth:160}
                ,{field:'MAJORNAME', title: '所学专业', fixed:'center', sort: true,minWidth:160}
                ,{field:'GRADUATIONTIME', title: '毕业时间', fixed:'center', sort: true,minWidth:110}
                ,{field:'BX', title: '在校表现', fixed:'center', sort: true,minWidth:110}
                ,{field:'GUAKE', title: '有无挂科', fixed:'center', sort: true,minWidth:110}
                ,{field:'TC', title: '特长', fixed:'center', sort: true,minWidth:110}
                ,{field:'RSTATE', title: '简历投递', fixed:'center', sort: true,minWidth:110}
                ,{field:'RrSTATE', title: '简历筛选', fixed:'center', sort: true,minWidth:110}
                ,{field:'STATEb',  title: '公布结果', fixed:'center', sort: true,minWidth:110,templet: function(d){
                        if(d.STATEb === "未公布")
                            return '<span class="layui-badge layui-bg-orange">'+d.STATEb+'</span>';
                        else
                            return '<span class="layui-badge layui-bg-green">'+d.STATEb+'</span>';
                    }}
               ,{field:'STATEc',  title: '', fixed:'center',minWidth:100,templet: function(d){
                        switch(d.STATEc){
                            case "已放弃" :
                                return '<span class="layui-badge layui-bg-gray" title="已放弃">'+d.STATEc+'</span>';
                                break;
                            case "未完成" :
                                return '<span class="layui-badge layui-bg-orange" title="未完成">'+d.STATEc+'</span>';
                                break;
                            case "已完成" :
                                return '<span class="layui-badge layui-bg-green">'+d.STATEc+'</span>';
                                break;
                            default: '<span></span>'; break;
                        }}}
            ]]
            ,page: true
            , done: function () {
                soulTable.render(this);
            }
        });

        $("#searchbtn").on('click', () => {
            tableRenders();
        });
    });

    function tableRenders() {
        sdat = '${path}/Do/ZZResume/getZZResumeListLayuiJson?flowid=${fid}&'+$('#sform').serialize();
        //执行重载
        ZzRecommendTable.reload('listTables', {
            url: sdat
            ,method: 'get'
            ,page:  {
                curr: 1 //重新从第 1 页开始
            }
            ,where: {
            }
        }, 'data');
    }
</script>
</body>
</html>